import request from '@/utils/request'
// let baseURL = process.env.VUE_APP_BASE_API_ServerAPI

// 登录
export function login (data) {
  return request({
    // baseURL: baseURL,
    url: '/vue-element-admin/user/login',
    method: 'post',
    data
  })
}

export function getInfo (token) {
  return request({
    url: '/vue-element-admin/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout () {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
}

export function getUserList (params) {
  return request({
    url: '/api/user/list',
    method: 'get',
    params
  })
}

export function addUser (data) {
  return request({
    url: '/api/user/add',
    method: 'post',
    data
  })
}

export function updateUser (data) {
  return request({
    url: '/api/user/update',
    method: 'post',
    data
  })
}

export function deleteUser (id) {
  return request({
    url: '/api/user/delete',
    method: 'post',
    data: { id }
  })
}
